Change 'NO_EXPAT' sense to HAVE LIBEXPAT in the last intrusive way in prep
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 6 Apr 2006 06:02:39 +0000 (06:02 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Thu, 6 Apr 2006 06:02:39 +0000 (06:02 +0000)
for autoconf.

12 files changed:
gpsbabel/cet_util.c
gpsbabel/cet_util.h
gpsbabel/defs.h
gpsbabel/geo.c
gpsbabel/google.c
gpsbabel/gpx.c
gpsbabel/hsa_ndv.c
gpsbabel/kml.c
gpsbabel/navicache.c
gpsbabel/tef_xml.c
gpsbabel/wfff_xml.c
gpsbabel/xmlgeneric.c

index a208f194b7e09f16f3163ee9fe4992b18639a790..1a50afbc6ce1756abf57104c4144d2c2543c2828 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <stdarg.h>
 
 #include "defs.h"
 #include "cet.h"
 #include "cet_util.h"
 
-#ifndef NO_EXPAT
+#if HAVE_LIBEXPAT
 # include <expat.h>
 #endif
 
@@ -112,7 +113,7 @@ cet_str_cp1252_to_utf8(const char *src)
  *
  *
  */
+#if HAVE_LIBEXPAT
 int XMLCALL cet_lib_expat_UnknownEncodingHandler(void *data, const XML_Char *encoding, XML_Encoding *info)
 {
        cet_cs_vec_t *cs;
@@ -143,6 +144,7 @@ int XMLCALL cet_lib_expat_UnknownEncodingHandler(void *data, const XML_Char *enc
            
        return XML_STATUS_OK;
 }
+#endif
 
 
 char *
@@ -1098,7 +1100,7 @@ int cet_vfprintf(FILE *stream, const cet_cs_vec_t *src_vec, const char *fmt, va_
        int res, ct;
        va_list args2;          /* vsnprintf makes args unusable for a second try */
        
-       va_copy(args2, args);
+       __va_copy(args2, args);
        ct = vsnprintf(buff, sizeof(buff), fmt, args);
        if (ct >= (int)sizeof(buff)) {
            cout = xmalloc(ct + 1);
index 402f7641249ebb4393eba114087f03dc0929e972..b3ce840a8095b3b0f5f3c54694eb924cb57f3897 100644 (file)
 
 #include <ctype.h>
 #include <stdio.h>
+#include "config.h"
 #include "cet.h"
 
-#ifndef NO_EXPAT
+#if HAVE_LIBEXPAT
 # include <expat.h>
 #endif
 
@@ -88,7 +89,9 @@ extern cet_cs_vec_t cet_cs_vec_utf8;
 #endif
 #endif  /* not defined XMLCALL */
 
+#if HAVE_LIBEXPAT
 int XMLCALL cet_lib_expat_UnknownEncodingHandler(void *data, const XML_Char *encoding, XML_Encoding *info);
+#endif
 
 /* helpers */
 
index be2571d7544f313a3b287b2cf7184a22195c2fd6..c639d0c3f7bb13edab28bc5cd94d8e1a71c55e41 100644 (file)
@@ -25,6 +25,7 @@
 #include <string.h>
 #include <stdarg.h>
 #include <stddef.h>
+#include "config.h"
 #include "queue.h"
 #include "gbtypes.h"
 #include "cet.h"
index a92c71547297f41e056be74c8a9011241b425e23..f50d446c786d413a1c44384bdf418d3c7280e13c 100644 (file)
@@ -37,7 +37,7 @@ arglist_t geo_args[] = {
 #define MYNAME "geo"
 #define MY_CBUF 4096
 
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
 static void
 geo_rd_init(const char *fname)
 {
index 4fc499c2f966ab855e572d12c11ba34ba310db1e..85dbab357a9b508baf4449983fd8b48a8957f61c 100644 (file)
@@ -32,7 +32,7 @@ static int serial = 0;
 #define MYNAME "google"
 #define MY_CBUF 4096
 
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
 static void
 google_rd_init(const char *fname)
 {
index 57fbb1694e121b4965b25d699055e92232fb3629..bd9c583aa6ac250cecb4d86db31a8c489069b0a9 100644 (file)
@@ -23,7 +23,7 @@
 #include "xmlgeneric.h"
 #include "cet_util.h"
 #include "garmin_fs.h"
-#ifndef NO_EXPAT
+#if HAVE_LIBEXPAT
        #include <expat.h>
        static XML_Parser psr;
 #endif
@@ -1026,13 +1026,18 @@ gpx_end(void *data, const char *el)
        *s = 0;
 }
 
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
 static void
 gpx_rd_init(const char *fname)
 {
        fatal(MYNAME ": This build excluded GPX support because expat was not installed.\n");
 }
 
+static void 
+gpx_rd_deinit(void) 
+{
+}
+
 #else /* NO_EXPAT */
 
 static void
@@ -1126,7 +1131,6 @@ gpx_rd_init(const char *fname)
        XML_SetCharacterDataHandler(psr, gpx_cdata);
        fs_ptr = NULL;
 }
-#endif
 
 static 
 void 
@@ -1163,6 +1167,7 @@ gpx_rd_deinit(void)
        wpt_tmp = NULL;
        cur_tag = NULL;
 }
+#endif
 
 static void
 gpx_wr_init(const char *fname)
@@ -1182,7 +1187,7 @@ gpx_wr_deinit(void)
 void
 gpx_read(void)
 {
-#ifndef NO_EXPAT
+#if HAVE_LIBEXPAT
        int len;
        int done = 0;
        char *buf = xmalloc(MY_CBUF_SZ);
@@ -1267,7 +1272,7 @@ gpx_read(void)
                }
        }
        xfree(buf);
-#endif /* NO_EXPAT */
+#endif /* HAVE_LIBEXPAT */
 }
 
 static void
index 973e4538e1c63bee1b698b409f6f98e574302965..4bdf7b1a1574382fa92d2574afcc1ea739198196 100644 (file)
@@ -18,7 +18,7 @@
  */
 #include "defs.h"
 #include "cet_util.h"
-#if !NO_EXPAT
+#if HAVE_LIBEXPAT
 #include <expat.h>
 static XML_Parser psr;
 #endif
@@ -53,7 +53,7 @@ arglist_t hsa_ndv_args[] = {
 #define FALSE  0
 
 
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
 static void
 hsa_ndv_rd_init(const char *fname)
 {
index 41c7842a7a40a2f5e8dc5bc2436bf66936d1bfb0..33eba05000a63bf3259bd6239185e74e2f7724a9 100644 (file)
@@ -72,7 +72,7 @@ arglist_t kml_args[] = {
 
 #define MYNAME "kml"
 
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
 static void
 kml_rd_init(const char *fname)
 {
index 2608a9e271cd1095eb62800d58c06f0ffc9e3198..8a2fe8a81c32ebf1a05a722784fe25632c3007da 100644 (file)
@@ -18,7 +18,7 @@
  */
 #include "defs.h"
 #include "cet_util.h"
-#if !NO_EXPAT
+#if HAVE_LIBEXPAT
 #include <expat.h>
 static XML_Parser psr;
 #endif
@@ -40,7 +40,7 @@ arglist_t nav_args[] = {
 #define MYNAME "navicache"
 #define MY_CBUF 4096
 
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
 static void
 nav_rd_init(const char *fname)
 {
index bcfa4054c5ef10f4b9ec1902e55128b70f841958..0fa364a6608509052a2d245f65f5a337b63c70bc 100644 (file)
@@ -42,7 +42,7 @@ static arglist_t tef_xml_args[] =
 
 #define MYNAME "TourExchangeFormat"
 
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
 void
 tef_xml_rd_init(const char *fname)
 {
index 647c515171d87e6c84a2d24db631efc434cff12a..d20bd16c393d2a491ffb753b9e8a69770dd04160 100644 (file)
@@ -45,7 +45,7 @@ arglist_t wfff_xml_args[] = {
 #define MYNAME "wfff_xml"
 #define MY_CBUF 4096
 
-#if NO_EXPAT
+#if ! HAVE_LIBEXPAT
 void
 wfff_xml_rd_init(const char *fname)
 {
index f999fa0db2f64150bcfb54f2b0cbc0abdd8234b5..3aae2d0ab275eea135f6a82264ba5b13fe497078 100644 (file)
@@ -23,7 +23,7 @@
 #include "xmlgeneric.h"
 #include "cet_util.h"
 
-#ifndef NO_EXPAT
+#if HAVE_LIBEXPAT
        #include <expat.h>
        static XML_Parser psr;
 #endif
@@ -207,6 +207,7 @@ xml_start(void *data, const char *el, const char **attr)
        }
 }
 
+#if HAVE_LIBEXPAT
 static void
 xml_cdata(void *dta, const XML_Char *s, int len)
 {
@@ -310,5 +311,21 @@ xml_deinit(void)
        }
        xg_ignore_taglist = NULL;
 }
+#else /* HAVE_LIBEXPAT */
+void
+xml_init(const char *fname, xg_tag_mapping *tbl, const char *encoding)
+{
+       fatal("This format does not support reading XML files as libexpat was not present.");
+}
+
+void xml_read(void)
+{
+}
+
+void xml_deinit(void)
+{
+}
+
+#endif /* HAVE_LIBEXPAT */
 
 /******************************************/